home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Path: uu4news.netcom.com!friend!news
- From: rich@kastle.com (Richard Krehbiel)
- Subject: Re: fastest code
- Message-ID: <1996Apr10.110121.6784@friend.kastle.com>
- Sender: news@friend.kastle.com (News)
- Reply-To: rich@kastle.com
- Organization: Kastle Development Associates
- X-Newsreader: Forte Free Agent 1.0.82
- References: <316112A2.7D37@public.sta.net.cn> <4k1sntINNdd6@keats.ugrad.cs.ubc.ca> <3165a356.105975604@204.248.25.97> <4k4ll5$fq@solutions.solon.com> <4ke5v6$17k@samba.rahul.net>
- Date: Wed, 10 Apr 1996 12:02:13 GMT
-
- Oliver Hellwig <hellwig@rahul.net> wrote:
-
- > Just a few days ago I used Watcom 10.5 to
- >compile the Linux NE2000 driver and I had to track down a bug
- >were the watcom compiler optimized away some critical code.
- >The code in question looked like this:
-
- > for (i=0; i<16; i++)
- > prom[i] = prom[i+i];
-
- >The output of the compiler left the loop but removed the
- >assignment! Disabling optimizations will make it compile
- >correctly as will using pointers. However, this
- >bug greatly dampened my enthusiasm for Watcom C.
-
- I suspect a proper "volatile" declaration on "prom" might have fixed
- this, i.e. if "prom" is currently declared "char prom[16]" then it
- should be declared "volatile char prom[16]". I would not consider
- this an optimizer bug in Watcom.
-
- --
- Richard Krehbiel, Kastle Systems, Arlington VA USA
- rich@kastle.com (work) or richk@mnsinc.com (personal)
-
-